package org.advanced.collection;


import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

/**
 * @author John.zhang
 * @version Id: LinkedLists, v 1.0 2020/11/30 16:24 ZhiYong Exp $
 * 灵活的空间要求，存储空间不要求连续
 * 不支持下标访问，支持顺序遍历检索
 * 双向链表新增删除比政策的数组效率高
 */
public class LinkedLists {

    public static void main(String[] args) {
        List<String> list = Arrays.asList("a","b","c");
        LinkedList<String> linkedList = new LinkedList<>(list);
        linkedList.push("d");
        linkedList.add("e");

        linkedList.get(0);
        System.out.println(linkedList.toString());
    }
}
